namespace Logic.Map.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class addtableall : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Sys_Area",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_Layers = c.Int(),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_SimpleSpelling = c.String(maxLength: 50),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_ItemsDetail",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ItemId = c.String(maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_ItemCode = c.String(maxLength: 50),
                        F_ItemName = c.String(maxLength: 50),
                        F_SimpleSpelling = c.String(maxLength: 500),
                        F_IsDefault = c.Boolean(),
                        F_Layers = c.Int(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_Items",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_IsTree = c.Boolean(),
                        F_Layers = c.Int(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_ModuleButton",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ModuleId = c.String(maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_Layers = c.Int(),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_Icon = c.String(maxLength: 50),
                        F_Location = c.Int(),
                        F_JsEvent = c.String(maxLength: 50),
                        F_UrlAddress = c.String(maxLength: 500),
                        F_Split = c.Boolean(),
                        F_IsPublic = c.Boolean(),
                        F_AllowEdit = c.Boolean(),
                        F_AllowDelete = c.Boolean(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_Module",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_Layers = c.Int(),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_Icon = c.String(maxLength: 50),
                        F_UrlAddress = c.String(maxLength: 500),
                        F_Target = c.String(maxLength: 50),
                        F_IsMenu = c.Boolean(),
                        F_IsExpand = c.Boolean(),
                        F_IsPublic = c.Boolean(),
                        F_AllowEdit = c.Boolean(),
                        F_AllowDelete = c.Boolean(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_Organize",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ParentId = c.String(maxLength: 50),
                        F_Layers = c.Int(),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_ShortName = c.String(maxLength: 50),
                        F_CategoryId = c.String(maxLength: 50),
                        F_ManagerId = c.String(maxLength: 500),
                        F_TelePhone = c.String(maxLength: 20),
                        F_MobilePhone = c.String(maxLength: 20),
                        F_WeChat = c.String(maxLength: 50),
                        F_Fax = c.String(maxLength: 20),
                        F_Email = c.String(maxLength: 50),
                        F_AreaId = c.String(maxLength: 50),
                        F_Address = c.String(maxLength: 50),
                        F_AllowEdit = c.Boolean(),
                        F_AllowDelete = c.Boolean(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_RoleAuthorize",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_ItemType = c.Int(),
                        F_ItemId = c.String(maxLength: 50),
                        F_ObjectType = c.Int(),
                        F_ObjectId = c.String(maxLength: 50),
                        F_SortCode = c.Int(),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 500),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_Role",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_OrganizeId = c.String(maxLength: 50),
                        F_Category = c.Int(),
                        F_EnCode = c.String(maxLength: 50),
                        F_FullName = c.String(maxLength: 50),
                        F_Type = c.String(maxLength: 50),
                        F_AllowEdit = c.Boolean(),
                        F_AllowDelete = c.Boolean(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_UserLogOn",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_UserId = c.String(),
                        F_UserPassword = c.String(maxLength: 50),
                        F_UserSecretkey = c.String(maxLength: 50),
                        F_AllowStartTime = c.DateTime(),
                        F_AllowEndTime = c.DateTime(),
                        F_LockStartDate = c.DateTime(),
                        F_LockEndDate = c.DateTime(),
                        F_FirstVisitTime = c.DateTime(),
                        F_PreviousVisitTime = c.DateTime(),
                        F_LastVisitTime = c.DateTime(),
                        F_ChangePasswordDate = c.DateTime(),
                        F_MultiUserLogin = c.Boolean(),
                        F_LogOnCount = c.Int(),
                        F_UserOnLine = c.Boolean(),
                        F_Question = c.String(maxLength: 50),
                        F_AnswerQuestion = c.String(maxLength: 500),
                        F_CheckIPAddress = c.Boolean(),
                        F_Language = c.String(maxLength: 50),
                        F_Theme = c.String(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_User",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_Account = c.String(maxLength: 50),
                        F_RealName = c.String(maxLength: 50),
                        F_NickName = c.String(maxLength: 50),
                        F_HeadIcon = c.String(maxLength: 50),
                        F_Gender = c.Boolean(),
                        F_Birthday = c.DateTime(),
                        F_MobilePhone = c.String(maxLength: 20),
                        F_Email = c.String(maxLength: 50),
                        F_WeChat = c.String(maxLength: 50),
                        F_ManagerId = c.String(maxLength: 50),
                        F_SecurityLevel = c.Int(),
                        F_Signature = c.String(maxLength: 500),
                        F_OrganizeId = c.String(maxLength: 50),
                        F_DepartmentId = c.String(),
                        F_RoleId = c.String(maxLength: 500),
                        F_DutyId = c.String(maxLength: 500),
                        F_IsAdministrator = c.Boolean(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        Gongzixishu = c.Decimal(precision: 18, scale: 2),
                        GongziDanjia = c.Decimal(precision: 18, scale: 2),
                        Banci = c.String(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_DbBackup",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_BackupType = c.String(maxLength: 50),
                        F_DbName = c.String(maxLength: 50),
                        F_FileName = c.String(maxLength: 50),
                        F_FileSize = c.String(maxLength: 50),
                        F_FilePath = c.String(maxLength: 500),
                        F_BackupTime = c.DateTime(),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_FilterIP",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_Type = c.Boolean(),
                        F_StartIP = c.String(maxLength: 50),
                        F_EndIP = c.String(maxLength: 50),
                        F_SortCode = c.Int(),
                        F_DeleteMark = c.Boolean(),
                        F_EnabledMark = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_DeleteUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Sys_Log",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_Date = c.DateTime(),
                        F_Account = c.String(maxLength: 50),
                        F_NickName = c.String(maxLength: 50),
                        F_Type = c.String(maxLength: 50),
                        F_IPAddress = c.String(maxLength: 50),
                        F_IPAddressName = c.String(maxLength: 50),
                        F_ModuleId = c.String(maxLength: 50),
                        F_ModuleName = c.String(maxLength: 50),
                        F_Result = c.Boolean(),
                        F_Description = c.String(maxLength: 500),
                        F_CreatorTime = c.DateTime(),
                        F_CreatorUserId = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Instructions",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(),
                        F_LastModifyTime = c.DateTime(),
                        Type = c.Int(),
                        Title = c.String(),
                        ContenAbstract = c.String(),
                        State = c.Boolean(),
                        AddUserName = c.String(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Carriage",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        CarriageID = c.String(maxLength: 30),
                        CarType = c.String(maxLength: 100),
                        Remark = c.String(maxLength: 300),
                        State = c.Boolean(),
                        Capacity = c.Decimal(nullable: false, precision: 18, scale: 2),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Course",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Name = c.String(maxLength: 50),
                        CourseStartTime = c.DateTime(),
                        CourseEndTime = c.DateTime(),
                        CourseOldPrice = c.Decimal(precision: 18, scale: 2),
                        CourseNowPrice = c.Decimal(precision: 18, scale: 2),
                        PhoneNumber = c.Int(),
                        Province = c.String(maxLength: 20),
                        City = c.String(maxLength: 20),
                        Area = c.String(maxLength: 20),
                        Address = c.String(maxLength: 50),
                        XPoint = c.Decimal(precision: 18, scale: 2),
                        YPoint = c.Decimal(precision: 18, scale: 2),
                        Image = c.String(),
                        Video = c.String(),
                        Description = c.String(),
                        CourseAlert = c.String(maxLength: 200),
                        ClickRate = c.Int(),
                        FollowRate = c.Int(),
                        BoughtRate = c.Int(),
                        TranspondNumber = c.Int(),
                        State = c.Boolean(),
                        CourseState = c.Int(),
                        IsDrafts = c.Boolean(),
                        RejectReason = c.String(maxLength: 200),
                        CourseTime_F_Id = c.String(maxLength: 50),
                        CourseType_F_Id = c.String(maxLength: 50),
                        PublicName_F_Id = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.CourseTime", t => t.CourseTime_F_Id)
                .ForeignKey("dbo.CourseType", t => t.CourseType_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.PublicName_F_Id)
                .Index(t => t.CourseTime_F_Id)
                .Index(t => t.CourseType_F_Id)
                .Index(t => t.PublicName_F_Id);
            
            CreateTable(
                "dbo.CourseTime",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Name = c.String(maxLength: 50),
                        ClassTime = c.String(maxLength: 200),
                        State = c.Boolean(),
                        AddUserName = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.CourseType",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        ClassName = c.String(maxLength: 50),
                        ContenAbstract = c.String(maxLength: 200),
                        State = c.Boolean(),
                        AddUserName = c.String(maxLength: 50),
                        addd = c.String(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.GudaoCar",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        ThingsName = c.String(maxLength: 50),
                        Fenhao = c.String(maxLength: 100),
                        ArriveDateTime = c.DateTime(nullable: false),
                        isAccomplishStatistics = c.Boolean(),
                        AccomplishStatisticsTime = c.DateTime(),
                        IsAccomplishPermitThrough = c.Boolean(),
                        AccomplishPermitThroughTime = c.DateTime(),
                        isAccomplishPaiche = c.Boolean(),
                        AccomplishPaicheTime = c.DateTime(),
                        IsAccomplishduiwei = c.Boolean(),
                        AccomplishduiweiTime = c.DateTime(),
                        Remark = c.String(maxLength: 300),
                        ArriveStation = c.String(maxLength: 300),
                        Weight = c.Decimal(precision: 18, scale: 2),
                        UnitNumber = c.Decimal(precision: 18, scale: 2),
                        Customers = c.String(maxLength: 50),
                        State = c.Boolean(),
                        BelongCarriage_F_Id = c.String(maxLength: 128),
                        BelongPathway_F_Id = c.String(maxLength: 128),
                        Operation_F_Id = c.String(maxLength: 128),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Carriage", t => t.BelongCarriage_F_Id)
                .ForeignKey("dbo.Pathway", t => t.BelongPathway_F_Id)
                .ForeignKey("dbo.OperationGudaoCar", t => t.Operation_F_Id)
                .Index(t => t.BelongCarriage_F_Id)
                .Index(t => t.BelongPathway_F_Id)
                .Index(t => t.Operation_F_Id);
            
            CreateTable(
                "dbo.Pathway",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Name = c.String(maxLength: 100),
                        Remark = c.String(maxLength: 300),
                        State = c.Boolean(),
                        Length = c.Decimal(nullable: false, precision: 24, scale: 2),
                        CarNumber = c.Int(),
                        IsStatistics = c.Boolean(),
                        IsPermitThrough = c.Boolean(),
                        IsCounterpoint = c.Boolean(),
                        IsPaiche = c.Boolean(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.OperationGudaoCar",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        OperationTime = c.DateTime(),
                        IsRollBack = c.Boolean(),
                        RollbackTime = c.DateTime(),
                        IsExecute = c.Boolean(),
                        ExecuteDateTime = c.DateTime(),
                        OperationType = c.Int(),
                        State = c.Boolean(),
                        OperationPersion_F_Id = c.String(maxLength: 50),
                        WorkPlan_F_Id = c.String(maxLength: 128),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Sys_User", t => t.OperationPersion_F_Id)
                .ForeignKey("dbo.WorkPlan", t => t.WorkPlan_F_Id)
                .Index(t => t.OperationPersion_F_Id)
                .Index(t => t.WorkPlan_F_Id);
            
            CreateTable(
                "dbo.WorkPlan",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        BianZhiDateTime = c.DateTime(nullable: false),
                        BianZhiPlan = c.String(),
                        Remark = c.String(),
                        State = c.Boolean(),
                        DiaoChePersion_F_Id = c.String(maxLength: 50),
                        DiaoDuPerson_F_Id = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Sys_User", t => t.DiaoChePersion_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.DiaoDuPerson_F_Id)
                .Index(t => t.DiaoChePersion_F_Id)
                .Index(t => t.DiaoDuPerson_F_Id);
            
            CreateTable(
                "dbo.HistoryGudaoCar",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        ThingsName = c.String(maxLength: 50),
                        Fenhao = c.String(maxLength: 100),
                        ArriveDateTime = c.DateTime(nullable: false),
                        isAccomplishStatistics = c.Boolean(),
                        AccomplishStatisticsTime = c.DateTime(),
                        IsAccomplishPermitThrough = c.Boolean(),
                        AccomplishPermitThroughTime = c.DateTime(),
                        isAccomplishPaiche = c.Boolean(),
                        AccomplishPaicheTime = c.DateTime(),
                        IsAccomplishduiwei = c.Boolean(),
                        AccomplishduiweiTime = c.DateTime(),
                        Remark = c.String(maxLength: 300),
                        ArriveStation = c.String(maxLength: 300),
                        Weight = c.Decimal(precision: 18, scale: 2),
                        UnitNumber = c.Decimal(precision: 18, scale: 2),
                        Customers = c.String(maxLength: 50),
                        State = c.Boolean(),
                        BelongCarriage_F_Id = c.String(maxLength: 128),
                        BelongPathway_F_Id = c.String(maxLength: 128),
                        Operation_F_Id = c.String(maxLength: 128),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Carriage", t => t.BelongCarriage_F_Id)
                .ForeignKey("dbo.Pathway", t => t.BelongPathway_F_Id)
                .ForeignKey("dbo.OperationGudaoCar", t => t.Operation_F_Id)
                .Index(t => t.BelongCarriage_F_Id)
                .Index(t => t.BelongPathway_F_Id)
                .Index(t => t.Operation_F_Id);
            
            CreateTable(
                "dbo.InformMessages",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Title = c.String(maxLength: 50),
                        SendUserName = c.String(maxLength: 50),
                        SendTime = c.DateTime(),
                        State = c.Boolean(),
                        Remark = c.String(maxLength: 200),
                        Type = c.Int(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.PersonSalary",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        OperationTime = c.DateTime(),
                        Weight = c.Decimal(precision: 18, scale: 2),
                        EveryTimeSalary = c.Decimal(precision: 18, scale: 2),
                        BeforeOperationSalary = c.Decimal(precision: 18, scale: 2),
                        AfterOperationSalary = c.Decimal(precision: 18, scale: 2),
                        State = c.Boolean(),
                        EveryCarID_F_Id = c.String(maxLength: 128),
                        OperationGudaoCarEntity_F_Id = c.String(maxLength: 128),
                        Persion_F_Id = c.String(maxLength: 50),
                        SalaryEntity_F_Id = c.String(maxLength: 128),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Carriage", t => t.EveryCarID_F_Id)
                .ForeignKey("dbo.OperationGudaoCar", t => t.OperationGudaoCarEntity_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.Persion_F_Id)
                .ForeignKey("dbo.Salary", t => t.SalaryEntity_F_Id)
                .Index(t => t.EveryCarID_F_Id)
                .Index(t => t.OperationGudaoCarEntity_F_Id)
                .Index(t => t.Persion_F_Id)
                .Index(t => t.SalaryEntity_F_Id);
            
            CreateTable(
                "dbo.Salary",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 128),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Weight = c.Decimal(precision: 18, scale: 2),
                        NeedToPay = c.Decimal(precision: 18, scale: 2),
                        Remark = c.String(maxLength: 300),
                        CumulativeSalaryTime = c.DateTime(),
                        State = c.Boolean(),
                        Worker_F_Id = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Sys_User", t => t.Worker_F_Id)
                .Index(t => t.Worker_F_Id);
            
            CreateTable(
                "dbo.PositionRecord",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        State = c.Boolean(),
                        BanciUser_F_Id = c.String(maxLength: 50),
                        CreateAdmin_F_Id = c.String(maxLength: 50),
                        daokouyuanUser1_F_Id = c.String(maxLength: 50),
                        daokouyuanUser2_F_Id = c.String(maxLength: 50),
                        DiaochezhangUser_F_Id = c.String(maxLength: 50),
                        DispatcherUser_F_Id = c.String(maxLength: 50),
                        FusijiUser_F_Id = c.String(maxLength: 50),
                        HuoyunyunaUser1_F_Id = c.String(maxLength: 50),
                        HuoyunyunaUser2_F_Id = c.String(maxLength: 50),
                        ProductionUser_F_Id = c.String(maxLength: 50),
                        SijiUser_F_Id = c.String(maxLength: 50),
                        TougouyuanUser_F_Id = c.String(maxLength: 50),
                        ZhongzhuanyuanUser_F_Id = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Sys_User", t => t.BanciUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.CreateAdmin_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.daokouyuanUser1_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.daokouyuanUser2_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.DiaochezhangUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.DispatcherUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.FusijiUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.HuoyunyunaUser1_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.HuoyunyunaUser2_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.ProductionUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.SijiUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.TougouyuanUser_F_Id)
                .ForeignKey("dbo.Sys_User", t => t.ZhongzhuanyuanUser_F_Id)
                .Index(t => t.BanciUser_F_Id)
                .Index(t => t.CreateAdmin_F_Id)
                .Index(t => t.daokouyuanUser1_F_Id)
                .Index(t => t.daokouyuanUser2_F_Id)
                .Index(t => t.DiaochezhangUser_F_Id)
                .Index(t => t.DispatcherUser_F_Id)
                .Index(t => t.FusijiUser_F_Id)
                .Index(t => t.HuoyunyunaUser1_F_Id)
                .Index(t => t.HuoyunyunaUser2_F_Id)
                .Index(t => t.ProductionUser_F_Id)
                .Index(t => t.SijiUser_F_Id)
                .Index(t => t.TougouyuanUser_F_Id)
                .Index(t => t.ZhongzhuanyuanUser_F_Id);
            
            CreateTable(
                "dbo.SendCommercial",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Title = c.String(maxLength: 100),
                        Content = c.String(),
                        Type = c.Int(),
                        State = c.Boolean(),
                        SendTime = c.DateTime(),
                        ReadState = c.Int(),
                        ReaDateTime = c.DateTime(),
                        FromUserName = c.String(maxLength: 100),
                        SendUserName = c.String(maxLength: 100),
                        SendOfficeID = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.SendMembersInfos",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Title = c.String(maxLength: 100),
                        Content = c.String(),
                        Type = c.Int(),
                        State = c.Boolean(),
                        SendTime = c.DateTime(),
                        ReadState = c.Int(),
                        ReaDateTime = c.DateTime(),
                        FromUserName = c.String(maxLength: 100),
                        SendUserName = c.String(maxLength: 100),
                        SendOfficeID = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.ChargingStandards",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        Name = c.String(maxLength: 50),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        Type = c.Int(),
                        State = c.Boolean(),
                        SendTime = c.DateTime(),
                    })
                .PrimaryKey(t => t.F_Id);
            
            CreateTable(
                "dbo.Member",
                c => new
                    {
                        F_Id = c.String(nullable: false, maxLength: 50),
                        F_CreatorUserId = c.String(maxLength: 50),
                        F_CreatorTime = c.DateTime(),
                        F_DeleteMark = c.Boolean(),
                        F_DeleteUserId = c.String(maxLength: 50),
                        F_DeleteTime = c.DateTime(),
                        F_LastModifyUserId = c.String(maxLength: 50),
                        F_LastModifyTime = c.DateTime(),
                        PassWord = c.String(maxLength: 50),
                        RealName = c.String(maxLength: 30),
                        Nickname = c.String(maxLength: 30),
                        FileName = c.String(maxLength: 500),
                        WeChatOpenid = c.String(maxLength: 100),
                        Sex = c.String(maxLength: 10),
                        Birthday = c.DateTime(),
                        Tel = c.String(maxLength: 20),
                        Province = c.String(maxLength: 20),
                        City = c.String(maxLength: 20),
                        Area = c.String(maxLength: 20),
                        Address = c.String(maxLength: 50),
                        Email = c.String(maxLength: 50),
                        Status = c.Int(),
                        AddTime = c.DateTime(),
                        MoneyPrice = c.Decimal(precision: 18, scale: 2),
                        XPoint = c.Decimal(precision: 18, scale: 2),
                        YPoint = c.Decimal(precision: 18, scale: 2),
                        IsPassMerchant = c.Boolean(),
                        ApplicationTime = c.DateTime(),
                        logintype = c.Int(),
                        MerchantP_F_Id = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.F_Id)
                .ForeignKey("dbo.Sys_User", t => t.MerchantP_F_Id)
                .Index(t => t.MerchantP_F_Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Member", "MerchantP_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "ZhongzhuanyuanUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "TougouyuanUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "SijiUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "ProductionUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "HuoyunyunaUser2_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "HuoyunyunaUser1_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "FusijiUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "DispatcherUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "DiaochezhangUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "daokouyuanUser2_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "daokouyuanUser1_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "CreateAdmin_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PositionRecord", "BanciUser_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PersonSalary", "SalaryEntity_F_Id", "dbo.Salary");
            DropForeignKey("dbo.Salary", "Worker_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PersonSalary", "Persion_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.PersonSalary", "OperationGudaoCarEntity_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.PersonSalary", "EveryCarID_F_Id", "dbo.Carriage");
            DropForeignKey("dbo.HistoryGudaoCar", "Operation_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.HistoryGudaoCar", "BelongPathway_F_Id", "dbo.Pathway");
            DropForeignKey("dbo.HistoryGudaoCar", "BelongCarriage_F_Id", "dbo.Carriage");
            DropForeignKey("dbo.GudaoCar", "Operation_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.OperationGudaoCar", "WorkPlan_F_Id", "dbo.WorkPlan");
            DropForeignKey("dbo.WorkPlan", "DiaoDuPerson_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.WorkPlan", "DiaoChePersion_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.OperationGudaoCar", "OperationPersion_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.GudaoCar", "BelongPathway_F_Id", "dbo.Pathway");
            DropForeignKey("dbo.GudaoCar", "BelongCarriage_F_Id", "dbo.Carriage");
            DropForeignKey("dbo.Course", "PublicName_F_Id", "dbo.Sys_User");
            DropForeignKey("dbo.Course", "CourseType_F_Id", "dbo.CourseType");
            DropForeignKey("dbo.Course", "CourseTime_F_Id", "dbo.CourseTime");
            DropIndex("dbo.Member", new[] { "MerchantP_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "ZhongzhuanyuanUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "TougouyuanUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "SijiUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "ProductionUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "HuoyunyunaUser2_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "HuoyunyunaUser1_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "FusijiUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "DispatcherUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "DiaochezhangUser_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "daokouyuanUser2_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "daokouyuanUser1_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "CreateAdmin_F_Id" });
            DropIndex("dbo.PositionRecord", new[] { "BanciUser_F_Id" });
            DropIndex("dbo.Salary", new[] { "Worker_F_Id" });
            DropIndex("dbo.PersonSalary", new[] { "SalaryEntity_F_Id" });
            DropIndex("dbo.PersonSalary", new[] { "Persion_F_Id" });
            DropIndex("dbo.PersonSalary", new[] { "OperationGudaoCarEntity_F_Id" });
            DropIndex("dbo.PersonSalary", new[] { "EveryCarID_F_Id" });
            DropIndex("dbo.HistoryGudaoCar", new[] { "Operation_F_Id" });
            DropIndex("dbo.HistoryGudaoCar", new[] { "BelongPathway_F_Id" });
            DropIndex("dbo.HistoryGudaoCar", new[] { "BelongCarriage_F_Id" });
            DropIndex("dbo.WorkPlan", new[] { "DiaoDuPerson_F_Id" });
            DropIndex("dbo.WorkPlan", new[] { "DiaoChePersion_F_Id" });
            DropIndex("dbo.OperationGudaoCar", new[] { "WorkPlan_F_Id" });
            DropIndex("dbo.OperationGudaoCar", new[] { "OperationPersion_F_Id" });
            DropIndex("dbo.GudaoCar", new[] { "Operation_F_Id" });
            DropIndex("dbo.GudaoCar", new[] { "BelongPathway_F_Id" });
            DropIndex("dbo.GudaoCar", new[] { "BelongCarriage_F_Id" });
            DropIndex("dbo.Course", new[] { "PublicName_F_Id" });
            DropIndex("dbo.Course", new[] { "CourseType_F_Id" });
            DropIndex("dbo.Course", new[] { "CourseTime_F_Id" });
            DropTable("dbo.Member");
            DropTable("dbo.ChargingStandards");
            DropTable("dbo.SendMembersInfos");
            DropTable("dbo.SendCommercial");
            DropTable("dbo.PositionRecord");
            DropTable("dbo.Salary");
            DropTable("dbo.PersonSalary");
            DropTable("dbo.InformMessages");
            DropTable("dbo.HistoryGudaoCar");
            DropTable("dbo.WorkPlan");
            DropTable("dbo.OperationGudaoCar");
            DropTable("dbo.Pathway");
            DropTable("dbo.GudaoCar");
            DropTable("dbo.CourseType");
            DropTable("dbo.CourseTime");
            DropTable("dbo.Course");
            DropTable("dbo.Carriage");
            DropTable("dbo.Instructions");
            DropTable("dbo.Sys_Log");
            DropTable("dbo.Sys_FilterIP");
            DropTable("dbo.Sys_DbBackup");
            DropTable("dbo.Sys_User");
            DropTable("dbo.Sys_UserLogOn");
            DropTable("dbo.Sys_Role");
            DropTable("dbo.Sys_RoleAuthorize");
            DropTable("dbo.Sys_Organize");
            DropTable("dbo.Sys_Module");
            DropTable("dbo.Sys_ModuleButton");
            DropTable("dbo.Sys_Items");
            DropTable("dbo.Sys_ItemsDetail");
            DropTable("dbo.Sys_Area");
        }
    }
}
